package testThread;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.domain.Sort.Order;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.web.util.HtmlUtils;

import com.alibaba.fastjson.JSONObject;

import ltTest.controller.TestController;
import ltTest.entity.User;
import ltTest.server.TestService;

public class TestEnum {
	
    public static void main(String[] args) {
//    	ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
//    	TestController bean = (TestController) app.getBean("testController");
//    	User tset = bean.tset(new User(100,100,0,null),null);
//    	System.out.println("end :" + tset);
    	String s = "{'appid':'1106131569','accessToken':'0911DCB3750D48F1FA228448D6A5E48E','openid':'721FA443ECB20BEA69B566664CD4A10B'}";
    	JSONObject json = JSONObject.parseObject(s);
    	System.out.println(json.get("appid"));
    	System.out.println("test");
    }
    
    private static void add(){
    	
    }
    
    private static void htmlEscape(){
    	String html = "<p><table><tr><td>1111111</td></tr></table></p>";  
    	String string = HtmlUtils.htmlEscape(html);
    	System.out.println(html);
    	System.out.println(string);
    	   
    	String string2 = HtmlUtils.htmlUnescape(string);
    	System.out.println(string2);
	}
    
    public void test(){
    	List<String> list = new ArrayList<String>();
    	System.out.println(list.size());
    	System.out.println(list);
    	System.out.println("--------------");
    	list.add(null);
    	System.out.println(list.size());
    	System.out.println(list);
    }
}

class A implements Serializable{
	/**
	 * 
	 */
	String a;
	String  b;
	public A(String a, String b) {
		super();
		this.a = a;
		this.b = b;
	}
	
	public A() {
		super();
		// TODO Auto-generated constructor stub
	}

	public String getA() {
		return a;
	}
	public void setA(String a) {
		this.a = a;
	}
	public String getB() {
		return b;
	}
	public void setB(String b) {
		this.b = b;
	}

	@Override
	public String toString() {
		return "A [a=" + a + ", b=" + b + "]";
	}
}